﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Krile.Common;
namespace Highkick.Common.Searchs
{
    public class KeywordSearch : DefaultSearchDataBase
    {
        public override string Identification
        {
            get { return Define.PluginId + "_SD_KW_HIGHKICK"; }
        }

        protected override bool IsMatchedInner(Krile.Kernel.Data.Status status)
        {
            var hs = status as Data.HStatus;
            if (hs == null) return false;
            int point = 0;
            if ((point = hs.Text.Original.IndexOf("=")) == -1) return false;
            var haystack = hs.Text.Original.Substring(0, point);
            return IsSearchDataMatched(haystack);
        }

        public override string Description
        {
            get { return "キーワード" + this.Arguments + "を含むはてなハイクのステータスを検索します。"; }
        }

        public override string Name
        {
            get { return "はてなハイク キーワード検索"; }
        }

        public override object Clone()
        {
            return new KeywordSearch() { Arguments = Arguments, Exclude = Exclude, IgnoreCase = IgnoreCase, SearchType = SearchType };
        }

        public override string Class
        {
            get { return "HKeyword"; }
        }
    }
}
